package com.ny.kind;
class Dog {
    private String name;
    private int age;
    private String color;


    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }


    public String getName() {
        return name;
    }

    // 获取年龄
    public int getAge() {
        return age;
    }

    // 获取毛色
    public String getColor() {
        return color;
    }


    public void makeSound() {
        System.out.println("汪汪汪");
    }
}

class Cat {
    private String name;
    private int age;
    private String color;


    public Cat(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }


    public String getName() {
        return name;
    }


    public int getAge() {
        return age;
    }


    public String getColor() {
        return color;
    }

    public void makeSound() {
        System.out.println("喵喵喵");
    }
}

public class dong {
    public static void main(String[] args) {
        Dog dog = new Dog("旺财", 3, "黄色");
        System.out.println("狗的名字是" + dog.getName() + "，年龄是" + dog.getAge() + "，毛色是" + dog.getColor());
        dog.makeSound();


        Cat cat = new Cat("咪咪", 2, "白色");
        System.out.println("猫的名字是" + cat.getName() + "，年龄是" + cat.getAge() + "，毛色是" + cat.getColor());
        cat.makeSound();
    }
}